<template>
  <div>
  <button @click="handleLogin">登录</button>
  </div>
</template>

<script>
import { setToken } from "@/utils/auth";
import { getInfo } from "@/api/login.js";
export default {
  components: {
  },
  data() {
    return {
    
    };
  },
  methods: {
    handleLogin() {
      getInfo().then((res) => {
        setToken(res.data.data.token);
        this.$router.push("/index");
      });
    },
  },
};
</script>

<style>
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
.iconfonts {
  font-size: 100rpx;
}
</style>


